<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!--NewPage-->
<HTML>
<HEAD>
<TITLE>
FinanceLib (POI API Documentation)
</TITLE>

<META NAME="keywords" CONTENT="org.apache.poi.ss.formula.functions.FinanceLib class">

<LINK REL ="stylesheet" TYPE="text/css" HREF="../../../../../../stylesheet.css" TITLE="Style">

<SCRIPT type="text/javascript">
function windowTitle()
{
    parent.document.title="FinanceLib (POI API Documentation)";
}
</SCRIPT>
<NOSCRIPT>
</NOSCRIPT>

</HEAD>

<BODY BGCOLOR="white" onload="windowTitle();">


<!-- ========= START OF TOP NAVBAR ======= -->
<A NAME="navbar_top"><!-- --></A>
<A HREF="#skip-navbar_top" title="Skip navigation links"></A>
<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY="">
<TR>
<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
<A NAME="navbar_top_firstrow"><!-- --></A>
<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY="">
  <TR ALIGN="center" VALIGN="top">
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="class-use/FinanceLib.html"><FONT CLASS="NavBarFont1"><B>Use</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A>&nbsp;</TD>
  </TR>
</TABLE>
</TD>
<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
</EM>
</TD>
</TR>

<TR>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
&nbsp;<A HREF="../../../../../../org/apache/poi/ss/formula/functions/FinanceFunction.html" title="class in org.apache.poi.ss.formula.functions"><B>PREV CLASS</B></A>&nbsp;
&nbsp;<A HREF="../../../../../../org/apache/poi/ss/formula/functions/Fixed0ArgFunction.html" title="class in org.apache.poi.ss.formula.functions"><B>NEXT CLASS</B></A></FONT></TD>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
  <A HREF="../../../../../../index.html?org/apache/poi/ss/formula/functions/FinanceLib.html" target="_top"><B>FRAMES</B></A>  &nbsp;
&nbsp;<A HREF="FinanceLib.html" target="_top"><B>NO FRAMES</B></A>  &nbsp;
&nbsp;<SCRIPT type="text/javascript">
  <!--
  if(window==top) {
    document.writeln('<A HREF="../../../../../../allclasses-noframe.html"><B>All Classes</B></A>');
  }
  //-->
</SCRIPT>
<NOSCRIPT>
  <A HREF="../../../../../../allclasses-noframe.html"><B>All Classes</B></A>
</NOSCRIPT>


</FONT></TD>
</TR>
<TR>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
  SUMMARY:&nbsp;NESTED&nbsp;|&nbsp;FIELD&nbsp;|&nbsp;CONSTR&nbsp;|&nbsp;<A HREF="#method_summary">METHOD</A></FONT></TD>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
DETAIL:&nbsp;FIELD&nbsp;|&nbsp;CONSTR&nbsp;|&nbsp;<A HREF="#method_detail">METHOD</A></FONT></TD>
</TR>
</TABLE>
<A NAME="skip-navbar_top"></A>
<!-- ========= END OF TOP NAVBAR ========= -->

<HR>
<!-- ======== START OF CLASS DATA ======== -->
<H2>
<FONT SIZE="-1">
org.apache.poi.ss.formula.functions</FONT>
<BR>
Class FinanceLib</H2>
<PRE>
java.lang.Object
  <IMG SRC="../../../../../../resources/inherit.gif" ALT="extended by "><B>org.apache.poi.ss.formula.functions.FinanceLib</B>
</PRE>
<HR>
<DL>
<DT><PRE>public final class <B>FinanceLib</B><DT>extends java.lang.Object</DL>
</PRE>

<P>
<DL>
<DT><B>Author:</B></DT>
  <DD>Amol S. Deshmukh &lt; amolweb at ya hoo dot com &gt;


 This class is a functon library for common fiscal functions.
 <b>Glossary of terms/abbreviations:</b>
 <br/>
 <ul>
 <li><em>FV:</em> Future Value</li>
 <li><em>PV:</em> Present Value</li>
 <li><em>NPV:</em> Net Present Value</li>
 <li><em>PMT:</em> (Periodic) Payment</li>

 </ul>
 For more info on the terms/abbreviations please use the references below
 (hyperlinks are subject to change):
 </br>Online References:
 <ol>
 <li>GNU Emacs Calc 2.02 Manual: http://theory.uwinnipeg.ca/gnu/calc/calc_203.html</li>
 <li>Yahoo Financial Glossary: http://biz.yahoo.com/f/g/nn.html#y</li>
 <li>MS Excel function reference: http://office.microsoft.com/en-us/assistance/CH062528251033.aspx</li>
 </ol>
 <h3>Implementation Notes:</h3>
 Symbols used in the formulae that follow:<br/>
 <ul>
 <li>p: present value</li>
 <li>f: future value</li>
 <li>n: number of periods</li>
 <li>y: payment (in each period)</li>
 <li>r: rate</li>
 <li>^: the power operator (NOT the java bitwise XOR operator!)</li>
 </ul>
 [From MS Excel function reference] Following are some of the key formulas
 that are used in this implementation:
 <pre>
 p(1+r)^n + y(1+rt)((1+r)^n-1)/r + f=0   ...{when r!=0}
 ny + p + f=0                            ...{when r=0}
 </pre></DD>
</DL>
<HR>

<P>

<!-- ========== METHOD SUMMARY =========== -->

<A NAME="method_summary"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2">
<B>Method Summary</B></FONT></TH>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static&nbsp;double</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../../org/apache/poi/ss/formula/functions/FinanceLib.html#fv(double, double, double, double, boolean)">fv</A></B>(double&nbsp;r,
   double&nbsp;n,
   double&nbsp;y,
   double&nbsp;p,
   boolean&nbsp;t)</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Future value of an amount given the number of payments, rate, amount
 of individual payment, present value and boolean value indicating whether
 payments are due at the beginning of period
 (false => payments are due at end of period)</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static&nbsp;double</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../../org/apache/poi/ss/formula/functions/FinanceLib.html#nper(double, double, double, double, boolean)">nper</A></B>(double&nbsp;r,
     double&nbsp;y,
     double&nbsp;p,
     double&nbsp;f,
     boolean&nbsp;t)</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static&nbsp;double</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../../org/apache/poi/ss/formula/functions/FinanceLib.html#npv(double, double[])">npv</A></B>(double&nbsp;r,
    double[]&nbsp;cfs)</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;calculates the Net Present Value of a principal amount
 given the discount rate and a sequence of cash flows
 (supplied as an array).</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static&nbsp;double</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../../org/apache/poi/ss/formula/functions/FinanceLib.html#pmt(double, double, double, double, boolean)">pmt</A></B>(double&nbsp;r,
    double&nbsp;n,
    double&nbsp;p,
    double&nbsp;f,
    boolean&nbsp;t)</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static&nbsp;double</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../../org/apache/poi/ss/formula/functions/FinanceLib.html#pv(double, double, double, double, boolean)">pv</A></B>(double&nbsp;r,
   double&nbsp;n,
   double&nbsp;y,
   double&nbsp;f,
   boolean&nbsp;t)</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Present value of an amount given the number of future payments, rate, amount
 of individual payment, future value and boolean value indicating whether
 payments are due at the beginning of period
 (false => payments are due at end of period)</TD>
</TR>
</TABLE>
&nbsp;<A NAME="methods_inherited_from_class_java.lang.Object"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor">
<TH ALIGN="left"><B>Methods inherited from class java.lang.Object</B></TH>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD><CODE>clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait</CODE></TD>
</TR>
</TABLE>
&nbsp;
<P>

<!-- ============ METHOD DETAIL ========== -->

<A NAME="method_detail"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2">
<B>Method Detail</B></FONT></TH>
</TR>
</TABLE>

<A NAME="fv(double, double, double, double, boolean)"><!-- --></A><H3>
fv</H3>
<PRE>
public static double <B>fv</B>(double&nbsp;r,
                        double&nbsp;n,
                        double&nbsp;y,
                        double&nbsp;p,
                        boolean&nbsp;t)</PRE>
<DL>
<DD>Future value of an amount given the number of payments, rate, amount
 of individual payment, present value and boolean value indicating whether
 payments are due at the beginning of period
 (false => payments are due at end of period)
<P>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>r</CODE> - rate<DD><CODE>n</CODE> - num of periods<DD><CODE>y</CODE> - pmt per period<DD><CODE>p</CODE> - future value<DD><CODE>t</CODE> - type (true=pmt at end of period, false=pmt at begining of period)</DL>
</DD>
</DL>
<HR>

<A NAME="pv(double, double, double, double, boolean)"><!-- --></A><H3>
pv</H3>
<PRE>
public static double <B>pv</B>(double&nbsp;r,
                        double&nbsp;n,
                        double&nbsp;y,
                        double&nbsp;f,
                        boolean&nbsp;t)</PRE>
<DL>
<DD>Present value of an amount given the number of future payments, rate, amount
 of individual payment, future value and boolean value indicating whether
 payments are due at the beginning of period
 (false => payments are due at end of period)
<P>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>r</CODE> - <DD><CODE>n</CODE> - <DD><CODE>y</CODE> - <DD><CODE>f</CODE> - <DD><CODE>t</CODE> - </DL>
</DD>
</DL>
<HR>

<A NAME="npv(double, double[])"><!-- --></A><H3>
npv</H3>
<PRE>
public static double <B>npv</B>(double&nbsp;r,
                         double[]&nbsp;cfs)</PRE>
<DL>
<DD>calculates the Net Present Value of a principal amount
 given the discount rate and a sequence of cash flows
 (supplied as an array). If the amounts are income the value should
 be positive, else if they are payments and not income, the
 value should be negative.
<P>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>r</CODE> - <DD><CODE>cfs</CODE> - cashflow amounts</DL>
</DD>
</DL>
<HR>

<A NAME="pmt(double, double, double, double, boolean)"><!-- --></A><H3>
pmt</H3>
<PRE>
public static double <B>pmt</B>(double&nbsp;r,
                         double&nbsp;n,
                         double&nbsp;p,
                         double&nbsp;f,
                         boolean&nbsp;t)</PRE>
<DL>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>r</CODE> - <DD><CODE>n</CODE> - <DD><CODE>p</CODE> - <DD><CODE>f</CODE> - <DD><CODE>t</CODE> - </DL>
</DD>
</DL>
<HR>

<A NAME="nper(double, double, double, double, boolean)"><!-- --></A><H3>
nper</H3>
<PRE>
public static double <B>nper</B>(double&nbsp;r,
                          double&nbsp;y,
                          double&nbsp;p,
                          double&nbsp;f,
                          boolean&nbsp;t)</PRE>
<DL>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>r</CODE> - <DD><CODE>y</CODE> - <DD><CODE>p</CODE> - <DD><CODE>f</CODE> - <DD><CODE>t</CODE> - </DL>
</DD>
</DL>
<!-- ========= END OF CLASS DATA ========= -->
<HR>


<!-- ======= START OF BOTTOM NAVBAR ====== -->
<A NAME="navbar_bottom"><!-- --></A>
<A HREF="#skip-navbar_bottom" title="Skip navigation links"></A>
<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY="">
<TR>
<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
<A NAME="navbar_bottom_firstrow"><!-- --></A>
<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY="">
  <TR ALIGN="center" VALIGN="top">
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="class-use/FinanceLib.html"><FONT CLASS="NavBarFont1"><B>Use</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A>&nbsp;</TD>
  </TR>
</TABLE>
</TD>
<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
</EM>
</TD>
</TR>

<TR>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
&nbsp;<A HREF="../../../../../../org/apache/poi/ss/formula/functions/FinanceFunction.html" title="class in org.apache.poi.ss.formula.functions"><B>PREV CLASS</B></A>&nbsp;
&nbsp;<A HREF="../../../../../../org/apache/poi/ss/formula/functions/Fixed0ArgFunction.html" title="class in org.apache.poi.ss.formula.functions"><B>NEXT CLASS</B></A></FONT></TD>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
  <A HREF="../../../../../../index.html?org/apache/poi/ss/formula/functions/FinanceLib.html" target="_top"><B>FRAMES</B></A>  &nbsp;
&nbsp;<A HREF="FinanceLib.html" target="_top"><B>NO FRAMES</B></A>  &nbsp;
&nbsp;<SCRIPT type="text/javascript">
  <!--
  if(window==top) {
    document.writeln('<A HREF="../../../../../../allclasses-noframe.html"><B>All Classes</B></A>');
  }
  //-->
</SCRIPT>
<NOSCRIPT>
  <A HREF="../../../../../../allclasses-noframe.html"><B>All Classes</B></A>
</NOSCRIPT>


</FONT></TD>
</TR>
<TR>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
  SUMMARY:&nbsp;NESTED&nbsp;|&nbsp;FIELD&nbsp;|&nbsp;CONSTR&nbsp;|&nbsp;<A HREF="#method_summary">METHOD</A></FONT></TD>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
DETAIL:&nbsp;FIELD&nbsp;|&nbsp;CONSTR&nbsp;|&nbsp;<A HREF="#method_detail">METHOD</A></FONT></TD>
</TR>
</TABLE>
<A NAME="skip-navbar_bottom"></A>
<!-- ======== END OF BOTTOM NAVBAR ======= -->

<HR>

                <i>Copyright 2014 The Apache Software Foundation or
        its licensors, as applicable.</i>
            
</BODY>
</HTML>
